home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls035c.1 / lib / vtcl / tests / raise.tcl / raise.tcl
Encoding:
Text File  |  1995-03-23  |  1.2 KB  |  52 lines

  1. #
  2. # Create two information dialog and raise them using
  3. # buttons in the main form
  4. # Note VtRaise is a Noop in CHARM
  5. #
  6.  
  7.  
  8. proc testNotCharm {nm} {
  9.     if { [ VtInfo -charm ] } {
  10.         VtClose
  11.         echo "$nm: This test exercises functionality not avail in CHARM (08.03.94)"
  12.     echo "i.e. VtRaise"
  13.         echo "Test should be ignored for CHARM use"
  14.         exit 0
  15.     }
  16. }
  17.  
  18. proc raiseCB {dlog cbs} {
  19.     VtRaiseDialog $dlog
  20. }
  21.  
  22.  
  23. proc quitCB {cbs} {
  24.     VtClose
  25. }
  26.  
  27. set app [VtOpen raise]
  28. testNotCharm raise
  29.  
  30. set dlog [VtFormDialog $app.form]
  31.  
  32. # create two info boxes
  33. set info1 [VtInformationDialog $dlog.info1 -message "Info Box A" -hidden 0]
  34. set info2 [VtInformationDialog $dlog.info2 -message "Info Box B" -hidden 0]
  35.  
  36. set lab [VtLabel $dlog.lab \
  37.      -label "Raise the dialogs by \npressing on either buttons"]
  38.  
  39. VtPushButton $dlog.b1 -label "Raise A" -callback "raiseCB $info1"
  40. VtPushButton $dlog.b2 -label "Raise B" -callback "raiseCB $info2" 
  41. VtPushButton $dlog.b3 -label "Raise Me" -callback "raiseCB $dlog"
  42. VtSeparator  $dlog.s -leftSide FORM -rightSide FORM
  43. VtPushButton $dlog.q  -label "Quit"     -callback quitCB \
  44.     -leftSide FORM \
  45.     -bottomSide FORM \
  46.     -rightSide FORM
  47.  
  48.  
  49. VtShow $dlog
  50.  
  51. VtMainLoop
  52.